import service from './config'

/**
 * 
 * @param {String} username 用户名
 * @param {String} password 密码
 * @returns voied
 */
// 登录
export const login = (username, password) => {
  return service.post("/users/login", {
    username,
    password
  })
}
//获取验证码

export const getCaptcha = () => service.get("/users/getCaptcha")


//校验验证码 

export const verifyCaptcha = captcha => service.get(`/users/verifyCaptcha?captcha=${captcha}`)


// 获取登录日志
export const getlog = (get = 1, count = 20) => {
  return service.get(`/getloginlog?page=${get}&count=${count}`, {
    // header: {
    //   "authorization": "xcvds"
    // }
  })
}

//获取权限菜单
export const getMenuList = () => service.get("/permission/getMenuList")
// 获取表格数据
export const getStuList = (params = { page: 1, count: 10, classes: "" }) => service.get("/students/getstulist",
  {
    params: {
      page: params.page,
      count: params.count,
      class: params.classes
    }
  })
// 根据学员名字搜索学员
export const searchStu = (page = 1, count = 10, key = "") => service.get("/students/searchstu",
  {
    params: {
      page,
      count,
      key,
    }
  })